#ifndef H_HMC5883L
#define H_HMC5883L

////////////////////////////////////////PUBLIC DEFINES/////////////////////////////////////////

#define LOCAL_MAGNETIC_DECLINAISON		13.38

//Values Config A
#define HMC5883_15HZ			0x70
#define HMC5883_75HZ			0x78

//Values Config B
#define HMC5883_1_3GA			0x20

//Values MODE
#define HMC5883_CONTINUOUS   		0x00

#define HMC5883_CONFIG_A     		0x00
#define HMC5883_CONFIG_B     		0x01
#define HMC5883_MODE         		0x02
#define HMC5883_X_MSB        		0x03
#define HMC5883_X_LSB        		0x04
#define HMC5883_Z_MSB        		0x05
#define HMC5883_Z_LSB        		0x06
#define HMC5883_Y_MSB        		0x07
#define HMC5883_Y_LSB        		0x08
#define HMC5883_STATUS       		0x09
#define HMC5883_IDENT_A      		0x0A
#define HMC5883_IDENT_B      		0x0B
#define HMC5883_IDENT_C      		0x0C

////////////////////////////////////////PUBLIC STRUCTURES/////////////////////////////////////////
typedef struct 
{
	float x; 
	float y; 
	float z;
}S_Mag;

////////////////////////////////////////PUBLIC FUNCTIONS/////////////////////////////////////////
void HMC5883LInit( int fd );
void HMC5883LRead( int fd, S_Mag *mag);
void HMC5883LCalibrate( int fd );
#endif
	
